package com.bcbim.smart_water.inspection.service;

import com.bcbim.common.sys.Code;
import com.bcbim.smart_water.inspection.mapper.InspectionMapper;
import com.bcbim.smart_water_interface.inspection.dao.InspectionDAO;
import com.bcbim.smart_water_interface.inspection.dto.InspectionStatisticsDTO;
import com.bcbim.smart_water_interface.inspection.service.InspectionService;
import com.bcbim.smart_water_interface.inspection.vo.ListInspectionVO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @version V 1.0.0
 * @Description：
 * @Author: haomeijie
 * @Date: 2021/11/10 16:07
 **/
@Service(timeout = 60 * 1000, group = "inspection", version = "1.0.0")
public class InspectionServiceImpl implements InspectionService {
    @Autowired
    private InspectionMapper inspectionMapper;

    @Override
    public int insertInspection(InspectionDAO inspectionDAO) {
        return inspectionMapper.insertInspection(inspectionDAO);
    }

    @Override
    public int updateInspection(InspectionDAO inspectionDAO) {
        return inspectionMapper.updateInspection(inspectionDAO);
    }

    @Override
    public String selectInspectionCountByUserId(String userId) {
        return inspectionMapper.selectInspectionCountByUserId(userId);
    }

    @Override
    public int listInspectionCount(InspectionStatisticsDTO inspectionStatisticsDTO) {
        return inspectionMapper.listInspectionCount(inspectionStatisticsDTO);
    }

    @Override
    public List<ListInspectionVO> listInspection(InspectionStatisticsDTO inspectionStatisticsDTO) {
        return inspectionMapper.listInspection(inspectionStatisticsDTO);
    }

    @Override
    public int getProblemTotal(InspectionStatisticsDTO inspectionStatisticsDTO) {
        return inspectionMapper.getProblemTotal(inspectionStatisticsDTO);
    }

    @Override
    public List<Code> listInspectionByUserId(String userId) {
        return inspectionMapper.listInspectionByUserId(userId);
    }
}
